<a><img src="<?= base_url() ?>img/logoijf.gif" width="200" height="20" alt="teste"></a>
<br>
<br>
    <h3><center>PLANILHA DE PAGAMENTO DA PENSAO GIAAH <?php echo substr($competenciaativa, 4, 2) . "/" . substr($competenciaativa, 0, 4); ?></center></h3>
    <table border="1" >
        <thead>
            <tr>
            <tr bgcolor ="gray">
                <th>Agencia</th>
                <th>Dv</th>
                <th>Conta</th>
                <th>Dv</th>
                <th>Nome</th>
                <th>Valor</th>
            </tr>

            <?php
            $total = 0;
            foreach ($lista as $item) {
                ?>
                <tr>
                    <td><?php echo $item->agencia; ?></td>
                    <td><?php echo $item->agencia_dv; ?></td>
                    <td><?php echo $item->conta; ?></td>
                    <td><?php echo $item->conta_dv; ?></td>
                    <td><?php echo $item->nome; ?></td>
                    <td>R$ <?php echo number_format($item->valor, 2, ",", "."); ?></td>
                </tr>

                <?php
                $total = $total + $item->valor;
            }
            ?>
            <tr>
            <tr bgcolor ="gray">
                <td colspan="5">TOTAL</td>
                <td>R$ <?php echo number_format($total, 2, ",", "."); ?></td>
            </tr>
    </table>
